﻿using System;

namespace WpInsights.Core
{
    using System.Xml.Serialization;

    [XmlRoot(ElementName = "stackPoint", Namespace = "")]
    public class StackPoint
    {
        public StackPoint()
        {
            this.Description = string.Empty;
            this.Parameters = string.Empty;

            // required for rendering
            this.MethodInfo = string.Empty;
            this.Tk = 1;
        }

        [XmlElement("ID")]
        public int Frame { get; set; }

        [XmlElement("module")]
        public String Image { get; set; }

        [XmlElement("description")]
        public string Function { get; set; }

        [XmlElement("nOffset")]
        public int Offset { get; set; }

        /// <summary>
        /// Just to pass xsd validation
        /// </summary>
        [XmlElement("method")]
        public string Description { get; set; }

        /// <summary>
        /// Just to pass the xsd validation
        /// </summary>
        [XmlElement("parameters")]
        public string Parameters { get; set; }


        [XmlElement("methodInfo")]
        public string MethodInfo { get; set; }

        [XmlElement("tk")]
        public int Tk { get; set; } 

        public void OnBeforeSerialize()
        {
            this.Description = this.Function;
        }
    }


}
